package com.autumn.security.crypto;

import com.autumn.security.user.IAutumnUser;

/**
 * 密码驱动
 * 
 * @author 老码农 2018-04-14 17:57:32
 */
public interface IAutumnPasswordProvider {

	/**
	 * 编码
	 * 
	 * @param user        用户详情
	 * @param rawPassword 密码
	 * @return
	 */
	String encode(IAutumnUser user, String rawPassword);

	/**
	 * 密码检查
	 * 
	 * @param user            用户
	 * @param rawPassword     原始密码
	 * @return
	 */
	boolean matches(IAutumnUser user, String rawPassword);

}
